package com.ran.mvpdemo.presenter;

import android.util.Log;

import com.ran.mvpdemo.model.MainModel;
import com.ran.mvpdemo.model.Model;
import com.ran.mvpdemo.view.MainView;


/**
 * Created by Bruce on 2017/5/17.
 */

public class MainPresenter implements Presenter<Model> {
    private static final String TAG = MainPresenter.class.getSimpleName();
    private MainView mainView;
    private MainModel mainModel;

    public MainPresenter(MainView mainView) {
        this.mainView = mainView;
        mainModel = new MainModel(this);
    }

    @Override
    public void loadData() {
        Log.d(TAG,"loadData()");
        mainModel.getData();
    }

    @Override
    public void loadDataSuccess(Model moddel) {
        Log.d(TAG,"loadDataSuccess()");
        mainView.showData(moddel);
    }

    @Override
    public void loadFail() {
        Log.d(TAG,"loadFail()");
    }
}
